package com.site.model.backend.system;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

import com.site.util.base.po.BaseApplicationInfo;

/**
 * 权限
 * @author lee 2012-10-12 
 *
 */
@Entity
@Table(name="m_system_authority")
public class AuthorityInfo extends BaseApplicationInfo {

	private static final long serialVersionUID = 1L;

	private Long id;
	
	/*
	 * 权限名称
	 */
	private String name;
	/*
	 * 描述
	 */
	private String description;
	
	@Id
	@Column(name = "ID")
	@GeneratedValue(generator = "system-uuid")
	@GenericGenerator(name = "system-uuid", strategy = "increment")
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	@Column(name = "NAME")
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	@Column(name = "DESCRIPTION")
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	
	@Override
	public boolean equals(Object obj) {
		if (!(obj instanceof AuthorityInfo)) {
			return false;
		} else if (((AuthorityInfo) obj).getId() != null && id != null
				&& ((AuthorityInfo) obj).getId().intValue() == id.intValue()) {
			return true;
		} else {
			return super.equals(obj);
		}
	}

	@Override
	public int hashCode() {
		// TODO Auto-generated method stub
		return id.hashCode();
	}
}
